package com.hongdee.crm.task.dao;

import com.hongdee.base.basedao.IBaseDao;
import com.hongdee.crm.maintain.entity.TCrmCarMaintain;

import java.util.List;
import java.util.Map;

/**
 * 名  称: ICrmCarMaintainMileTaskDao
 * 类  型: interface
 * 描  述: 车辆保养里程
 * 路  径: com.hongdee.crm.task.dao
 * 作  者: wangshuai
 * 日  期:2017/2/28 10:23
 */
public interface ITCrmCarMaintainMileTaskDao extends IBaseDao {

    /**
     * 获得最后一条的保养里程信息
     * @return
     * @throws Exception
     */
    public Map<String,Object> findLastMainTailMileInfo(String type,String companyId) throws Exception;

    /**
     * 根据条件查询保养信息
     * @return
     * @throws Exception
     */
    public List<Map<String,Object>> findMainTainList(String sqlStr,List<Object> params)throws Exception;

    /**
     * 查找首保信息
     * @param companyId
     * @param carId
     * @return
     */
    public Map<String,Object> findLastMainTainInfo(String companyId,String carId,String type) throws Exception;

    /**
     * 定保查询
     * @param companyId
     * @param carId
     * @return
     * @throws Exception
     */
    public List<Map<String,Object>> findDbMainTainList(String companyId,Long maintainTime,String carId) throws Exception;

    /**
     * 根据工单ID 查询是否已经存在
     * @param worderId
     * @return
     * @throws Exception
     */
    public Integer findWorderCounts(String worderId) throws Exception;


    /**
     * 批量插入车辆保养里程信息
     * @param lists
     * @throws Exception
     */
    public void insertMaintailLists(final List<TCrmCarMaintain> lists)throws Exception;
    public void insertAndDelMaintailLists(final List<String> lists)throws Exception;

    /**
     * 批量更新车辆下次保养里程、下次保养时间
     * @param lists
     * @throws Exception
     */
    public void updCarNextMaintainLists(final List<TCrmCarMaintain> lists)throws Exception;


}
